class Solution {
public:
    int minNumberOperations(vector<int>& target) {
        
        int nRet=target[0];
        for(int i=1;i<target.size();++i){
            nRet+=max(0,target[i]-target[i-1]);
        }

        return nRet;
    }
};
/*1 1 1 -1 -1*/
/*3 -2 0 1*/
